<template>
    <div>
<!--        <tips-info :allShow="true"></tips-info>-->
        <div>
            <epidemic-newly-handle ref="otherHandle" :newlyAddedType="newlyAddedType" :formData="formItem"></epidemic-newly-handle>
        </div>
<!--        <div class="div-bot">-->
<!--            <van-button round block type="info" @click="submit" class="city-card-common-btn">-->
<!--                添加-->
<!--            </van-button>-->
<!--        </div>-->
    </div>
</template>

<script>
import EpidemicNewlyHandle from './components/epidemic-newly-handle/index'
import {
  Toast
} from 'vant'
// import TipsInfo from '../../../components/tips-info/index'

export default {
  components: {
    // TipsInfo,
    EpidemicNewlyHandle
  },
  data () {
    return {
      newlyAddedType: '',
      formItem: {
        // tab组件中数据
        address: [{ loc_province: '', loc_city: '', loc_title: '', loc_address: '' }],
        person: [{ relation: '', name: '', cardno: '', loc_province: '', loc_city: '', loc_title: '', loc_address: '' }],
        children: [{ relation: '', name: '', cardno: '' }]
      }
    }
  },
  methods: {
    submit () {
      switch (this.$refs.otherHandle.tabValue) {
        // case 0:
        //   this.$refs.otherHandle.doAddress()
        //   break
        case 0:
          // this.$refs.otherHandle.doChildren()
          this.$router.push({
            name: 'epidemic-newly-added-new',
            query: { type: '0' }
          })
          break
        case 1:
          // this.$refs.otherHandle.doPerson()
          this.$router.push({
            name: 'epidemic-newly-added-new',
            query: { type: '1' }
          })
          break
        default:
          Toast.fail('提交失败')
          break
      }
    }
  },
  mounted () {
    this.$refs.otherHandle.getShow()
    if (this.$route.query.newlyAddedType) {
      this.newlyAddedType = this.$route.query.newlyAddedType
    }
  }
}
</script>

<style scoped>

    .div-bot {
        position: fixed;
        bottom: 5px;
        left: 1%;
        right: 1%;
        width: 98%;
    }

    .div-bot >>> .van-button--info {
        border: 1px solid #75ACDC;
    }

    .div-bot >>> .van-button {
        height: 2.5rem;
    }

    .city-card-common-btn {
        color: white;
        font-size: 12px;
        padding: 0;
        width: 100%;
        border-radius: 5px;
        text-align: center;
        background-color: #75ACDC;
    }

</style>
